/**
 *
 */
package com.angel.common.keyValue;

import java.util.Collection;



/**
 *
 * @author William
 *
 */
public interface KeyValueResult {

	/** Find result for a key.
	 *
	 * @param key to find its result.
	 * @return result for a key, if key has result, otherwise it returns null.
	 */
	public Object getResultFor(Object key);

	/** Find all results values for this and its sub key value results.
	 *
	 * @return an object collection.
	 */
	public <T extends Object> Collection<T> findAllResults();

	/**
	 * TODO Write a comment.
	 * @param <T>
	 * @return
	 */
	public <T extends Object> Collection<T> findAllKeys();

	/** Get result size for this result.
	 *
	 * @return result size for this result.
	 */
	public Long resultSize();

	/** Test if this result has results.
	 *
	 * @return true if it has results, otherwise it returns false.
	 */
	public Boolean hasResult();

	/** Test if this result has a specific result size.
	 *
	 * @param resultSize to test.
	 * @return true if it has a specific result size, otherwise it returns false.
	 */
	public Boolean hasResultSize(Long resultSize);

	/** Add a sub property value result as a property value result composite.
	 *
	 * @param propertyValueResult to add.
	 */
	public void addKeyValueResult(KeyValueResult keyValueResult);

	/** Add all items collection for this result.
	 *
	 * @param <T> items collection key values.
	 * @param keysValues to add as result.
	 */
	public <T extends KeyValue> void addAll(Collection<T> keysValues);

	/** Test if this result contains a result for a key.
	 *
	 * @param key to test.
	 * @return true if key has results, otherwise it returns false.
	 */
	public Boolean containsResultFor(Object key);
	
	/** Add a key value like a result.
	 * 
	 * @param <T> one key value object.
	 * @param keyValue to add as an result.
	 */
	public <T extends KeyValue> void addKeyValue(T keyValue);
	
	public <T extends Object> void addKeyValue(T key, T value);
	
	public <T extends Object> Boolean removeKeyValue(T key);
	
	public <T extends KeyValue> Boolean removeKeyValue(T key);

}
